// pages/custom/custom.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    showModal:false,
    dataarr:[{}],
    arr:[]
  },
  loginForm(data){
    var arr=[];
    console.log(data.detail.value);
    var make1=data.detail.value.make1;
    if(make1!=""){
      arr.push(make1)
    }
    var make2=data.detail.value.make2;
    if(make2!=""){
      arr.push(make2)
    }
    var make3=data.detail.value.make3;
    if(make3!=""){
      arr.push(make3)
    }
    var make4=data.detail.value.make4;
    if(make4!=""){
      arr.push(make4)
    }
    var make5=data.detail.value.make5;
    if(make5!=""){
      arr.push(make5)
    }
    var make6=data.detail.value.make6;
    if(make6!=""){
      arr.push(make6)
    }
    var make7=data.detail.value.make7;
    if(make7!=""){
      arr.push(make7)
    }
    var make8=data.detail.value.make8;
    if(make8!=""){
      arr.push(make8)
    }
    var make9=data.detail.value.make9;
    if(make9!=""){
      arr.push(make9)
    }
    var make10=data.detail.value.make10;
    if(make10!=""){
      arr.push(make10)
    }
    this.setData({dataarr:arr})
    console.log(this.data.dataarr);
    //实现随机抽取
    var length=this.data.dataarr.length;
    if(length==0){
      var arr="您还未填写定制项！";
      this.setData({arr:arr})
    }else{
      var id=Math.floor(Math.random()*length);
      var arr=this.data.dataarr[id];
      this.setData({arr:arr})
      console.log(this.data.arr);
    }
   
  },
  //实现页面转换
  change(){
   this.setData({
     showModal:true
   })
  },
  go: function() { 
    this.setData({
    showModal: false
    })
}
})